<template>
	<view>
		<view style="text-align: left;padding-bottom: 10rpx;">
			<view v-for="(item, index) in list" :key="index" class="item">
				<view style="color: #999999;font-size: 28upx;">
					<!-- <view v-if="item.orderType==2">
						<view style="margin-bottom: 8upx">{{item.orders}}</view>
					</view> -->
					<view v-if="item.payWay==0">零钱补缴</view>
					<view v-if="item.payWay==1">微信补缴</view>
					<view v-if="item.payWay==2">支付宝补缴</view>
					<view class="margin-tb-sm" @tap="copyOrderNumber(item.orderNo)">订单编号：{{item.orderNo}}
					<u-icon name="zhuanfa"></u-icon>
					</view>
					<view style="margin-bottom: 8upx"> 创建时间：{{item.createTime}}</view>
					<view style="margin-bottom: 8upx;text-align: right;">
						<text class="text-olive" style="font-size: 32upx;font-weight: 600"><text
								class="text-olive">-</text>{{item.payMoney}}元</text>
					</view>
				</view>
			</view>
			
			<empty v-if="list.length == 0" des="暂无明细"></empty>
		</view>
	</view>
</template>

<script>
	import empty from '@/components/empty.vue'
	export default {
		components: {
			empty
		},
		data() {
			return {
				list: [],
				page: 1,
				limit: 10,
				tabIndex: 1,
				checkReZhiShu: '否',
				checkReTuanZhang: '否',
				checkReFeiZhiShu: '否',
				scrollTop: false,
				contentText: {
					contentdown: '上拉显示更多',
					contentrefresh: '正在加载...',
					contentnomore: '没有更多数据了'
				}
			}
		},
		onLoad() {
			this.$queue.showLoading("加载中...");
			this.getList();
		},
		onPageScroll: function(e) {
			this.scrollTop = e.scrollTop > 200;
		},
		methods: {
			copyOrderNumber(orderNum) {
				uni.setClipboardData({
					data: orderNum,
					success: r => {
						this.$queue.showToast('复制成功')
					}
				});
			},
			getList() {
				let userId = this.$queue.getData('userId');
				let data = {
					page: this.page,
					limit: this.limit,
				}
				this.$Request.getT('/app/repairRecord/getRecordList',data).then(
					res => {
						if (res.code === 0) {
							if (this.page === 1) {
								this.list = res.data.records;
							} else {
								this.list = [...this.list, ...res.data.records];
							}
						}
						uni.stopPullDownRefresh();
						uni.hideLoading();
					});
			}
		},
		onReachBottom: function() {
			this.page = this.page + 1;
			this.getList();
		},
		onPullDownRefresh: function() {
			this.page = 1;
			this.getList();
		}
	}
</script>

<style lang="less">
	page {
		background: #FFFFFF;
	}

	.tui-tab-item-title {
		// color: #ffffff;
		font-size: 30rpx;
		height: 80rpx;
		line-height: 80rpx;
		flex-wrap: nowrap;
		white-space: nowrap;
	}

	.tui-tab-item-title-active {
		border-bottom: 1px solid #557EFD;
		color: #557EFD;
		font-size: 32upx;
		font-weight: bold;
		border-bottom-width: 6upx;
		text-align: center;
	}

	.item {
		background: #FFFFFF;
		padding: 32rpx;
		margin: 32rpx;
		font-size: 28rpx;
		box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
		border-radius: 16upx;
	}
</style>
